<?php

/*
 * B端操作功能模块
 * 功能：
 */

namespace Home\Model;

use Think\Model;

class UserModel extends Model {
    
    public function checkUser($account,$password){
        $where['account'] = $account;
        if(strlen($password)>1){
            $where['password'] = $password;
        }
        return $this->where($where)->find();
    }
    
    public function addUser($name,$account,$password,$is_admin){
	    $this->id = NULL;
        $this->user_name = $name;
        $this->account = $account;
        $this->password = $password;
        $this->is_admin = $is_admin;
        $this->create_time = time();
        return $this->add();
    }
    
}
